@extends('layouts.app')

@section('content')
    <div class="container">
        <div class="container-fluid">

            <!-- start page title -->
            <div class="row">
                <div class="col-12">
                    <div class="page-title-box">
                        <div class="page-title-right">
                            <ol class="breadcrumb m-0">
                                <li class="breadcrumb-item"><a href="{{ route('bugs.index') }}"><font
                                                style="vertical-align: inherit;"><font style="vertical-align: inherit;">BUG时间线</font></font></a>
                                </li>
                                <li class="breadcrumb-item"><a href="{{ route('bugs.create') }}"><font
                                                style="vertical-align: inherit;"><font style="vertical-align: inherit;">反馈bug</font></font></a>
                                </li>
                                <li class="breadcrumb-item active"><font style="vertical-align: inherit;"><font
                                                style="vertical-align: inherit;">控制台</font></font></li>
                            </ol>
                        </div>
                        <h4 class="page-title"><font style="vertical-align: inherit;"><font
                                        style="vertical-align: inherit;">控制台</font></font></h4>
                    </div>
                </div>
            </div>
            <!-- end page title -->
@include('layouts._success')
            <div class="row">
                @foreach($data as $list)
                    <div class="col-lg-4 col-xl-4">
                        <div class="card-box text-center">
                            <h4 class="mb-0"><font style="vertical-align: inherit;"><font
                                            style="vertical-align: inherit;">{{ $list->title }}</font></font></h4>
                            <p class="text-muted"><font style="vertical-align: inherit;"><font
                                            style="vertical-align: inherit;">{{ Auth::user()->email }}</font></font></p>
                            <form id="demo-form" data-parsley-validate="" action="{{route('bugs.destroy',$list->id)}}" method="POST" style="display: inline-block">
                                <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                <input type="hidden" name="_method" value="DELETE">
                            <button type="submit" class="btn btn-success btn-xs waves-effect mb-2 waves-light" ><font
                                        style="vertical-align: inherit;"><font
                                            style="vertical-align: inherit;">解决</font></font></button>
                            </form>
                            <form id="demo-form" data-parsley-validate="" action="{{route('bugs.update',$list->id)}}" method="POST" style="display: inline-block">
                                <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                <input type="hidden" name="_method" value="PUT">
                                <input type="hidden" name="status" value="2">
                                <input type="hidden" name="recipient" value="">
                            <button type="submit" class="btn btn-danger btn-xs waves-effect mb-2 waves-light" ><font
                                        style="vertical-align: inherit;"><font
                                            style="vertical-align: inherit;">放弃</font></font></button>
                            </form>

                            <div class="text-left mt-3">
                                <p class="text-muted mb-2 font-13"><strong><font style="vertical-align: inherit;"><font
                                                    style="vertical-align: inherit;">反馈人：</font></font></strong> <span
                                            class="ml-2"><font style="vertical-align: inherit;"><font
                                                    style="vertical-align: inherit;">{{ $list->author }}</font></font></span>
                                </p>

                                <p class="text-muted mb-2 font-13"><strong><font style="vertical-align: inherit;"><font
                                                    style="vertical-align: inherit;">反馈时间：</font></font></strong><span
                                            class="ml-2"><font style="vertical-align: inherit;"><font
                                                    style="vertical-align: inherit;">{{ $list->created_at }}</font></font></span>
                                </p>

                                <p class="text-muted mb-2 font-13"><strong><font style="vertical-align: inherit;"><font
                                                    style="vertical-align: inherit;">当前状态：</font></font></strong> <span
                                            class="ml-2 "><font style="vertical-align: inherit;"><font
                                                    style="vertical-align: inherit;">
                                                    <span class="badge badge-purple badge-pill"><font
                                                                style="vertical-align: inherit;"><font
                                                                    style="vertical-align: inherit;">解决中</font></font></span>
                                        </font></font></span></p>

                                <h4 class="font-13 text-uppercase"><font style="vertical-align: inherit;"><font
                                                style="vertical-align: inherit;">bug详情 ：</font></font></h4>
                                <p class="text-muted font-13 mb-3"><font style="vertical-align: inherit;"><font
                                                style="vertical-align: inherit;">
                                            {{ $list->content }}
                                        </font></font></p>
                                <p class="text-muted mb-1 font-13"><strong><font style="vertical-align: inherit;"><font
                                                    style="vertical-align: inherit;">附件查看及下载：</font></font></strong> <span
                                            class="ml-2"><font style="vertical-align: inherit;"><font
                                                    style="vertical-align: inherit;">
                                                 @if(!empty($data->other))
                                                    <a class="btn btn-link waves-effect" href="{{ route('download',$list->other) }}"><font
                                                                style="vertical-align: inherit; color: #1c95d4"><font
                                                                    style="vertical-align: inherit;">点击下载附件</font></font></a>
                                                @endif
                                            </font></font></span></p>
                            </div>
                        </div> <!-- end card-box -->

                    </div> <!-- end col-->
                @endforeach
            </div>
            <!-- end row-->

        </div>
    </div>
@endsection
